<template>

    <vue-table :data-source="tableList">
        <template slot="header">
            <tr>
                <th>姓名</th>
                <th>操作</th>
                <th>添加时间</th>
                <!--<th>操作</th>-->
            </tr>
        </template>
        <template slot="tbody" slot-scope="props">
            <tr>
                <td>{{props.item.u_name}}</td>
                <td>{{props.item.logs}}</td>
                <td>{{props.item.created_at}}</td>
                <!--<td class="col-lg-2">-->
                    <!--<button title="修改" class="btn btn-white btn-xs m-b-none"-->
                            <!--v-on:click="showEditDialog(props.item.id)">-->
                        <!--<i class="fa fa-pencil list-btn-i"></i>编辑-->
                    <!--</button>-->
                    <!--<button class="btn btn-white btn-xs m-b-none" title="删除"-->
                            <!--v-on:click="showDeleteDialog(props.item.id)">-->
                        <!--<i class=" fa fa-trash list-btn-i"></i>删除-->
                    <!--</button>-->
                <!--</td>-->

            </tr>
        </template>
    </vue-table>
</template>

<script>
    export default {
        props: {
            stateManager: {
                type: Object
            }
        },
        data: function () {
            return {
                list: this.$listDataSource({
                    url: 'api/student-logs'
                })
            };
        },
        methods: {
            showEditDialog: function (uuid) {
                this.stateManager.editDialogVisible = true;
                this.stateManager.editModelId = uuid;
            },
            showDeleteDialog: function (uuid) {
                this.stateManager.deleteDialogVisible = true;
                this.stateManager.deleteModelId = uuid;
            }
        },
        computed: {
            user(){
                return this.$store.state.user;
            },
            tableList(){
                if (this.stateManager.refreshList) {
                    this.list.fetch();
                    this.stateManager.refreshList = false;
                }
                return this.list;
            }
        }
    }
</script>